import React, { Component } from "react";
import { HashRouter as Router, Route, Switch } from "react-router-dom";
// import { BrowserRouter, Route, Switch } from "react-router-dom";
import App from "../App";
import antdMobile from "../view/antdmobile";

import MenuList from "../view/MenuList";
import HomePage from "../view/homePage/HomePage";
import ListPage from "../view/listPage/ListPage";
class index extends Component {
    render() {
        return (
            <Router>
                <App>
                    <Route path="/" exact component={antdMobile} />
                    <Route
                        path="/menu"
                        render={() => (
                            <MenuList>
                                <Switch>
                                    <Route
                                        path="/menu/homepage"
                                        component={HomePage}
                                    />
                                    <Route
                                        path="/menu/listpage"
                                        component={ListPage}
                                    />
                                </Switch>
                            </MenuList>
                        )}
                    />
                </App>
            </Router>
        );
    }
}

export default index;
